﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using System.Net;
using System.Windows.Media.Animation;
using UMLObjects;


namespace WIN_UML_Editor
{
    /// <summary>
    /// Interaction logic for UCArrow.xaml
    /// </summary>
    public partial class ArrowGuideLine : UserControl
    {
        private SolidColorBrush stdcolor = new SolidColorBrush(Colors.Black);
        private SolidColorBrush highlightcolor = new SolidColorBrush(Colors.MediumSeaGreen);

        //Constructor with start values.
        public ArrowGuideLine()
        {
            InitializeComponent();  
        }

        //Draw the guide (dashed line between Start and End).
        public void Update(Point Start, Point End,Boolean highlight)
        {
            guide.X1 = Start.X;
            guide.X2 = End.X;
            guide.Y1 = Start.Y;
            guide.Y2 = End.Y-5;

            DoubleCollection dashes = new DoubleCollection();
            dashes.Add(2);
            dashes.Add(2);
            guide.StrokeDashArray = dashes;

            if (highlight)
            {
                guide.StrokeThickness = 2;
                guide.Stroke = highlightcolor;
            }
            else
            {
                guide.StrokeThickness = 1;
                guide.Stroke = stdcolor;
            }
        }

    }
}
